<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
	<head>
		<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
		<title>Bundle Items &mdash; Intype Documentation</title>
		<link rel="stylesheet" href="css/static.css" type="text/css" />
		<link rel="stylesheet" href="css/content.css" type="text/css" />
	</head>
	<body>
		<div id="page"><div id="page-inner">

			<div id="sub-header"><div id="sub-header-inner">
				&nbsp;
			</div></div>

			<div id="cols">

				<div id="nav">
					<div id="nav-inner">
						<h1>Manual</h1>
						<ul>
							<li><a href="introduction.html" class="title"><span>Introduction</span></a></li>
							<li><a href="editing.html" class="title"><span>Editing</span></a>
							<ul>
								<li><a href="selections.html" class="title"><span>Selections</span></a></li>
								<li><a href="find_and_replace.html" class="title"><span>Find & Replace</span></a></li>
							</ul>
							</li>
							<li><a href="preferences.html" class="title"><span>Preferences</span></a>
							<ul>
								<li><a href="appearance_preferences.html" class="title"><span>Appearance Preferences</span></a></li>
							</ul>
							</li>
							
							<li><a href="scopes.html" class="title"><span>Scopes</span></a>
							<ul>
								<li><a href="document_scopes.html" class="title"><span>Document Scopes</span></a></li>
								<li><a href="application_scopes.html" class="title"><span>Application Scopes</span></a></li>
								<li><a href="scope_selectors.html" class="title"><span>Scopes Selectors</span></a></li>
								<li><a href="scope_naming_conventions.html" class="title"><span>Naming Conventions</span></a></li>
							</ul>
							</li>
							
							<li><a href="bundles.html" class="title"><span>Bundles</span></a>
							<ul>
								<li><a href="bundle_items.html" class="title"><span>Bundle Items</span></a></li>
								<li><a href="scopes.html" class="title"><span>Scopes</span></a></li>
								<li><a href="snippets.html" class="title"><span>Snippets</span></a></li>
								<li><a href="languages.html" class="title"><span>Languages</span></a></li>
								<li><a href="built_in_bundles.html" class="title"><span>Built-In Bundles</span></a></li>
							</ul>
							</li>
							<li><span class="title missing"><span>appendix</span></span>
							<ul>
								<li><a href="jasmine.html" class="title"><span>Jasmine</span></a></li>
								<li><a href="regular_expressions.html" class="title"><span>Regular Expressions</span></a></li>
							</ul>
							</li>
						</ul>
					</div>
				</div>

				<div id="content">
					<div id="content-right">
						<div id="content-left">
							<div id="content-inner">
								<h1>Bundle Items</h1>

<p>Bundle items are stored in subfolders of the bundle folder. Each subfolder contains items of same type. Intype will not load items that are not stored in propper folder.</p>

<p>The file name of a bundle item is used for constructing the ID of the item. The ID has this format:</p>

<pre><code>bundle.&lt;Bundle_Name&gt;.&lt;Item_Type&gt;.&lt;Item_Name&gt;
</code></pre>

<p>Where:</p>

<ul>
<li><code>&lt;Bundle_Name&gt;</code> is name of the <strong>folder</strong> the bundle is stored in (without <code>itBundle</code> extension).</li>
<li><code>&lt;Item_Type&gt;</code> specifies the type of the item</li>
<li><code>&lt;Item_Name&gt;</code> is name of the <strong>file</strong> the item is stored in (without extension).</li>
</ul>

<p>This identificator also tells us where the item is stored in. The path for <code>bundle.<strong class="h">HTML</strong>.snippet.<strong class="h">div</strong></code> is <code>bundles\<strong class="h">HTML</strong>.itBundle\snippets\<strong class="h">div</strong>.itSnippet</code>.</p>

<p>Examples:</p>

<table>
    <tr>
        <td><code>bundle.HTML.snippet.div</code></td>
        <td>&lt;div&gt;...&lt;/div&gt; snippet in HTML bundle</td>
    </tr>
    <tr>
        <td><code>bundle.JavaScript.language.JavaScript</code></td>
        <td>JavaScript grammar</td>
    </tr>
    <tr>
        <td><code>bundle.MyBundle.snippet.my_snippet</code></td>
        <td>Can be your snippet my_snippet.itSnippet in your MyBundle.itBundle</td>
    </tr>
</table>

<p>Each item is defined using [Jasmine][] format. And at least has to specify the <code>title</code> property, so Intype can display a nice name in the menus, and in the bundle editor. A snippet bundle item might look like this:</p>

<pre><code>{
    title: 'Wrap in Comment'
    key_equivalent: 'Ctrl+.'
    content: '&lt;!-- $SELECTED_TEXT --&gt;'
}
</code></pre>

<h2>Overriding Bundle Items</h2>

<p>When Intype is loading bundles, it is looking into both, installation and user bundles folders. Bundles and items in user folder have higher priority. You can define exactly the same bundle item in the same bundle in both base folders. In this case, the item stored in user folder is loaded and processed. This allows you to override built-in bundle item with your own.</p>

<p>For example, you want to change <code>DIV</code> snippet in HTML bundle. The original item is stored in:</p>

<pre>
C:\Program Files\Intype\<span class="h">bundles\HTML.itBundle\snippets\div.itSnippet</span>
</pre>

<p>So you create the same file in the same path <code>\bundles\HTML.itBundle\snippets\div.itSnippet</code> in your user folder:</p>

<pre>
C:\Program Files\Intype\<span class="h"><strong>user\</strong>bundles\HTML.itBundle\snippets\div.itSnippet</span>
</pre>

<p>Intype will then load your DIV snippet, and not the original one.</p>

<h2>Activating Bundle Items</h2>

<p>Most of bundle items can be activated with a shortcut or tab trigger, the best example would be the snippets. Some snippets can be launched with a shortcut (like <em>Ctrl+/</em> in HTML to wrap selected text into pair of tags), or with a tab trigger (like typing <code>table</code> in HTML document and pressing TAB).</p>

<p><strong>Note.</strong> Each item, that can be activated, must also specify the <a href="scopes.html">scope selector</a>.</p>

<h3>Tab Triggers</h3>

<p>A tab trigger is basically a keyword. User can type it, press a <em>TAB</em> key and the item is activated (if its <a href="scopes.html">scope selector matches the current scope</a>).</p>
							</div>
						</div>
					</div>
				</div>

			</div>

		</div>

		</div>
	</body>
</html>